[VHD][BOOT][UEFI] Boot Windows 8 From a VHD Drive On a GPT Disk Using UEFI BIOS
I had been dual booting two copies of Windows 8 prior to getting a new rig without any issues. Once I installed Windows 8.1 I can no longer boot a VHD from the GPT partitioned drive. 
 
My PC specifications 
Intel i7-4770k
ASUS SABERTOOTH Z87
16GB KINGSTON HYPERX BEAST DUAL-DDR3 2400MHz
2GB NVIDIA GEFORCE GTX 660 Ti 
120GB INTEL 520 SSD 
4TB WD CAVIAR BLACK WD2002FAEX
4TB WD CAVIAR BLACK WD2002FAEX (two way mirror = storage spaces)
15x BLU-RAY Writer Drive
CORSAIR 750W PRO HX750-80
Corsair H60 Hydro Series High Performance CPU Cooler
10/100/1000 GIGABIT LAN PORT 
Windows 8.1 Pro x64 

So I basically copied my existing VHD to the new data drive and created the relevant BCD entry, when I chose to boot from the VHD I am presented with an error saying Windows cannot boot and to choose another OS or the troubleshooting options (Ill post the exact error later as I am at work at the moment). 

I can boot the VHD inside Hyper-V without any issues, it just wont boot natively. I also created a brand new Windows 8.1 VHD and still the same thing happens. Once I created a new VHD I used bcdboot j:\windows /s j: to insert the attached VHD into the BCD store. 

So existing or brand new VHDs dont seem to work for me, any advice would be appreciated.   
December 5th, 2013 5:42pm

FYI - Boot from VHD has nothing to do with Hyper-V nor running within a VM.  The two are totally independent from each other.

When you boot the VM under Hyper-V, is it a generation 1 or a generation 2 VM?

Free Windows Admin Tool Kit Click here and download it now
December 5th, 2013 8:26pm

    

Well the Virtual disk is attached to my VM in Hyper-V and when I choose to I can reboot   into the VHD natively using all the resources of the host machine but in a virtual environment. 

http://technet.microsoft.com/en-us/library/gg318056(v=ws.10).aspx

http://blogs.technet.com/b/keithcombs/archive/2009/05/22/dual-boot-from-vhd-using-windows-7-and-windows-server-2008-r2.aspx

So I'm pretty sure they'll related unless Im missing something?

Generation 1 VM.

December 6th, 2013 12:30am

They are not.  Trust me.

Boot from VHD is unique and distinct and separate from Hyper-V.  One does not require the other in any way, shape, or form.

Boot from VHD is a method of bare metal provisioning.  Creating a VM, attaching a VHD and booting the VM is simply running that OS instance inside a virtual container.  You still have a management OS that you can switch to (in the case of boot from VHD you don't).

And, a generation 1 VM cannot UEFI boot.  Only a generation 2 VM can.  And BIOS boot and UEFI boot are not interchangeable.  The OS cannot simply adapt to the change (regardless if VM or physical).

Free Windows Admin Tool Kit Click here and download it now
December 6th, 2013 1:39am

  Not really. When you boot a VHD natively you both the host machine directly. The host is running the version of the OS which is on the vhd, not the version which is on the boot partition of the host's HDD. It is a form of multiboot, but the second OS is on a vhd, not an second HDD partition or drive on the host.

  When you boot a vhd under Hyper-V, you are booting a virtual machine. The host is still running its HDD version of the OS, the vm is running the version on the vhd.

  That is the vital difference. You are not booting the same "hardware" in both cases. The version on the vhd will be loaded with the drivers for the "hardware" setup of the vm (including the enhancements to make the OS run better in a vm) if it was created for the vm. The version on the HDD will have the drivers required for the host's installed hardware.

    The version created for one device is unlikely to boot successfully on the other. Sometimes it can be repaired in safe mode, but usually a repair install is required to fix the driver problems. 

  A vhd can fairly easily be moved from one (Hyper-V) vm to another because they all share the same basic hardware config (as a physical HDD with an OS installed can be moved between physical machine with identical specs) . The same does not apply between physical machines in general or between physical and virtual machines. 

December 6th, 2013 2:06am

Thanks Brian/Bill, advice is appreciated. I certainly didn't know that, I now have some more reading to do.

That answers the question; my Gen 1 VHD is not working as it's incompatible with my host UEFI, as well as my hardware changing since its a different spec machine.

My next question is can I convert a Gen 1 to a Gen 2 VHDX? or can you point me in the direction of a guide to create a Gen 2 bootable VHD which is UEFI compatible?   

EDIT: http://technet.microsoft.com/en-us/library/dn282285.aspx just read this and looks like I need to create a new VHDX and I should be good to go, I will give it a bash tomorrow and report back.

Again thanks for the advice so far!

  • Edited by mikeparkie Friday, December 06, 2013 8:40 AM
Free Windows Admin Tool Kit Click here and download it now
December 6th, 2013 2:06am

Yes, there is a script from John Howard that converts Generation 1 to Generation 2 (it is OS (on the VHD) dependent)

It is not supported, but does work.

http://blogs.technet.com/b/jhoward/archive/2013/11/14/hyper-v-generation-2-virtual-machines-part-10.aspx

December 6th, 2013 8:31pm

Thanks I will give that a go too. 

Meanwhile I have tried creating a new VHDX and then followed the below to create a new bootable instance of Windows 8.1

1. Create a new VHDX disk
2. Make sure it is formatted
3. Windows 8.1 install media
4. Launch Windows setup, when there press Shift + F10 to open the Command Prompt window
5. Diskpart:

            Type diskpart
            select vdisk file=D:\Virtual Machines\Windows 8.1 (Game)\Windows 8.1 (Game).vhdx

            If it says, DiskPart successfully selected the virtual disk file then type the following command and enter:
            attach vdisk

            Type exit to leave the Diskpart close the Command Prompt

6: Continue with setup and select the VHD that you created and click Next button (just ignore the warning Windows cant be installed on this drive)

But when the PC reboots after the install has completed I get the following error: Error

Any ideas?

Free Windows Admin Tool Kit Click here and download it now
December 6th, 2013 8:50pm

You are actually in Native Boot territory because of what you are doing.

I am not sure, but this might be useful:

http://technet.microsoft.com/en-us/library/dd799299(v=WS.10).aspx

And

http://en.community.dell.com/techcenter/extras/w/wiki/uefi-boot-to-vhd.aspx

December 6th, 2013 9:54pm

Thanks Brian, they explain pretty much what I have already tried, other then I created the VHDX on my larger data disk (D:). As a test I create a new VHDX and this time store the VHDX on the same drive as my primary OS and it worked, which led me to look at disk management and all of the recovery partitions and MS Reserved are store there too, and I think I remember reading somewhere that the VHD needs to be locate on the same disk as the BCD store etc for it to be able to boot! on my old setup, there were stored on my D: drive, hence that's why it previously worked.

So next I will move the BCD store etc do my D: disk and then create a new VHDX etc and fingers crossed I will up and running again!  


  
Free Windows Admin Tool Kit Click here and download it now
December 7th, 2013 9:04pm

I haven't had much luck trying to get the BCD store to boot natively from the VHD. Here's what I've tried without any luck, using Microsofts documentation: http://technet.microsoft.com/en-us/library/hh825709.aspx

diskpart
select vdisk file=e:\game.vhdx
attach vdisk
list volume
select volume 8
assign letter=v
select disk 0
list partition
select partition 2
assign letter=s
exit

cd v:\windows\system32
bcdboot v:\windows

bcdedit /copy {default} /d "Windows 8.1 (Game)"

bcdedit /set {my new guid} device vhd=[e:]\game.vhdx
bcdedit /set {my new guid} osdevice vhd=[e:]\game.vhdx

bcdedit /default {my new guid}

Reboot and I get the same error "recovery your pc needs to be repaired file \windows\system32\winload.efi" etc

The good thing about VHDs should be that you can access them from any disk, my C: is only 111GB so I don't have loads of room to run my VHD of the same disk.  

December 8th, 2013 6:30pm

I posted this issue on Neowin and someone kindly pointed out the answer, it's to do with storage spaces: 

http://www.neowin.net/forum/topic/1191873-native-boot-vhdx-from-second-drive/#entry596152197

Quote

What types of drives can I use with Storage Spaces?


You can use commodity drives attached via Serial-Attached SCSI (SAS), Serial ATA (SATA), or USB. Storage layers that abstract the physical disks are not compatible with Storage Spaces. This includes VHDs and pass-through disks in a virtual machine, and storage subsystems that layer a RAID implementation on top of the physical disks. iSCSI and Fibre Channel controllers are not supported by Storage Spaces.


From: http://social.techne...stions-faq.aspx 

Free Windows Admin Tool Kit Click here and download it now
December 9th, 2013 1:04am

Hi! there. This reply must have been untimely.

On any Windows OSes starting XP, if you intend to run it on "new rig" one must SYSPREP first.

It will make sure you running Windows OSes will become hardware agnostic and other stuff.

We almost always forget to note this part while dealing with VHD's.

March 30th, 2014 1:12pm

Did you make sure that the host volume has room for the vhdx to expand plus pagefile?

I assumed you did.

I also experience this, and my instinct just tell me may be vhdx requires 2TB+ to work. So I did. Create a 2TB expandable vhdx on a 3TB WD drive. It just work. Strange, there is nothing on the internet that requires vhdx to be a 2TB disk nor should be hosted on 2TB+ volume.

Free Windows Admin Tool Kit Click here and download it now
March 30th, 2014 1:24pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics